#-*- coding:utf-8 -*-
#实现webhook的调用接口 

import httplib
from bottle import run,route,response,post,get
import os,commands

@route("/gitlab",method=["GET","POST"])
def gitlabpull():
#为了减少到python的依赖将日志记录的功能放到了bash中
#安全验证功能没有添加

      #gitlablog = open("./gitlab.log","a")
      #gitlablog.write("begin==============\n")
      os.popen("/bin/bash /mnt/gitlabpull.sh") 
       
      #gitlablog.write("end================\n")
      #gitlablog.close()
      

if __name__ == '__main__':
  run(host='0.0.0.0',port='8080',debug=True,reloader=True)
else:
    application = bottle.default_app()
      
